package siestageek;

public class J01Account {
	
	//은행 예금 처리 프로그램
	//입력값 : 계좌번호,통장잔액,연이율
	//			인출액,입금액
	public static void main(String[] args) {
		//1 .변수 선언 및 초기화
		int aid = 0;
		int balance = 0;
		double interestRate = 0;
		String dateCreated; //2014-03-11
		double getMonthlyinterestRate;
		int withDraw ;
		int deposit ;

		//2. 계산 및 연산
		//변수 초기화 없이 수식을 사용하면 오류발생!!
		dateCreated = "2014-03-11";
		deposit = 0;
		withDraw = 0;
		
		getMonthlyinterestRate = interestRate / 12;
		balance = balance + deposit; //입금
		balance = balance + withDraw; //인출
		
		//3. 결과 출력
		System.out.println("계좌번호는"+aid);
		System.out.println("통장잔액은"+balance);
		System.out.println("연간이자율은"+interestRate);
		System.out.println("통장개설날짜는"+dateCreated);
		System.out.println("월간이자율은"+getMonthlyinterestRate);
		System.out.println("인출한예금은"+withDraw);
		System.out.println("예금한액수는"+deposit);
		
		//시험값 : 1122,20000,4.5
		//			2500인출,3000인출
		aid = 1122;
		balance = 20000; 
		interestRate = 4.5; //연이율
		withDraw = withDraw-2500;
		withDraw = withDraw-3000;
		
		
		//계산
		getMonthlyinterestRate = interestRate/12;
		balance = balance - withDraw; //출금
		
		//결과출력
		System.out.println("계좌번호는"+aid);
		System.out.println("통장잔액은"+balance);
		System.out.println("연간이자율은"+interestRate);
		System.out.println("통장개설날짜는"+dateCreated);
		System.out.println("월간이자율은"+getMonthlyinterestRate);
		System.out.println("인출한예금은"+withDraw);
		System.out.println("예금한액수는"+deposit);
		
		
	}

}
